<%-- 
    Document   : listagemTriagem
    Created on : Nov 17, 2012, 12:21:09 PM
    Author     : Gattini
--%>

<%@page import="br.com.maternity.componentes.grid.PersonalGrid"%>
<%@page import="java.util.List"%>
<%@page import="br.com.maternity.classes.entity.Atendimento"%>
<%@page import="br.com.maternity.classes.dao.AtendimentoDAO"%>
<%@page import="br.com.maternity.componentes.grid.PersonalGridStyle"%>
<%@page import="br.com.maternity.componentes.grid.PersonalGridColumn"%>
<%@page import="java.util.ArrayList"%>
<%@page contentType="text/html" pageEncoding="UTF-8"%>
<jsp:include page="../cabecalho.jsp"></jsp:include>
<%
    if(request.getParameter("cadastrado") != null){
        response.getWriter().write("<script>alert('Atendimento atualizado com sucesso!');</script>");
    }
%>
<meta http-equiv="refresh" content="60">
<div id="titulo">Relatorio de Consultas em situação Obstetra</div>
<div id="painel">
    
    <%
        ArrayList<PersonalGridColumn> cols = new ArrayList<PersonalGridColumn>();
        PersonalGridColumn c = new PersonalGridColumn("Prioridade", "getPrioridadeDescricao", "");
        List<String> qsf = new ArrayList<String>();
        qsf.add("getId");
        c.setRedirectLink(request.getContextPath() + "/acoes/enfObstetria.jsp?atendimento=@");
        c.setQueryStringFields(qsf);
        cols.add(c);

        c = new PersonalGridColumn("Data Avaliacao", "getDataConsulta", "dd/MM/yyyy HH:mm:ss");
        c.setWidth(22);
        c.setRedirectLink(request.getContextPath() + "/acoes/enfObstetria.jsp?atendimento=@");
        c.setQueryStringFields(qsf);
        cols.add(c);

        c = new PersonalGridColumn("Paciente", "getPacienteNome", "");
        c.setWidth(50);
        c.setRedirectLink(request.getContextPath() + "/acoes/enfObstetria.jsp?atendimento=@");
        c.setQueryStringFields(qsf);
        cols.add(c);

        c = new PersonalGridColumn("Responsavel", "getResponsavelNome", "");
        c.setWidth(25);
        c.setRedirectLink(request.getContextPath() + "/acoes/enfObstetria.jsp?atendimento=@");
        c.setQueryStringFields(qsf);
        cols.add(c);

        PersonalGridStyle rs = new PersonalGridStyle();

        AtendimentoDAO dao = new AtendimentoDAO();

        List<Atendimento> source = dao.selectByStatus(3);

        PersonalGrid g = new PersonalGrid("enfobstetria", "enfobstetria", new ArrayList<Object>(source), cols, rs);
    %>
    <%=g.render(null)%>
</div>
<br />
<a class="botao" href="../relatorios/listagemEnfObstetria.jsp">Atualizar</a>
<jsp:include page="../rodape.jsp"></jsp:include>